home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
501-525
/
disk_504
/
viewdir
/
viewd_docs
< prev
next >
Wrap
Text File
|
1992-05-06
|
4KB
|
113 lines
ViewDir - A Directory Reading program for your CLI C: directory
Jim Butterfield .. revised April 1990
There are two things that I can't get from commands DIR
or LIST. First: I often need to know how large a directory
is. When a disk is "loaded", I'm often looking to find
the area where I can make the most space savings. That's
often a directory, but finding its size can be a lot of
painstaking work.
Second: In many cases, I could use a hint as to kinds of files
I have. Text? .. a program ready to load and execute?
.. an AmigaBasic program? .. an IFF file? Sometimes
there's an icon to give me a hint. Sometimes not.
So: type ViewDir followed by the name of a drive or directory
and you'll get this kind of information.
The format is:
ViewDir [-b -i -t] DirectoryName
Note that flags -b, -i, and -t must come FIRST, before the
directory name, in true unfriendly UNIX fashion. Here's
what they mean:
-b Show me file/directory sizes in Blocks rather than bytes.
-i Do not print details on any file whose name ends with .info.
-t Don't worry about giving me file type.
You may supply the flags in any combination, separately (as
in ViewDir -b -i df0:) or together (as in ViewDir -ibt df0:).
Do follow any flag grouping with a space character.
* Blocks: if you're looking for space on a disk, this number is
a little more meaningful than bytes.
* Info: these files often make a list much bigger, and often do
not add useful information.
* Type: To guess at a type, the program will read the first 100
bytes of the file. Flag -t tells it not to bother.
FileTypes:
1. TextFile: The file contains regular alphabetic characters
(none from the extended character set), and NewLine, Return,
or Tab characters. If a file includes such things as escape
sequences, CSI, or FormFeed, it will NOT be shown as a TextFile.
2. Loadable: The file may be loaded as a program. This does
NOT mean that the file may be executed in every case, since
library items, overlays, and fonts are also classed as loadable
modules. Trying to execute those might give your computer a
headache.
3. WorkBenchObject and WorkBenchWindow: These (normally .info)
files are there to make the WorkBench screen do its job.
4. IFF files: The 'FORM' type files are detected and their
type given. Other IFF types might be caught via (8) below.
5. AmigaBasic: This one is a little tricky. Some AmigaBasic
programs are just text files, and will be so identified. Most
are specially formatted "tokenized" files; these will be
specifically classified.
6. FontList: files such as "Sapphire.font" which list the
various fonts available within this typeface. The fonts
themselves classify as "loadable" files.
7. Empty: nothing in the file.
8. ....TYPE: File is NOT text, but the first four characters
are alphanumeric; these are shown (examples: ...LIST, ....SPFK),
or ....PDPF), in case they are useful for identity.
9. FILE: none of the above. Might be an object file, a
formatted text file, or some other binary image. If you
specify the -t option, all non-empty files show this.
Assembly language source is included with this package.
If you want to add your own special file recognition
items (say, WordPerfect files, PageSetter documents,
special loadables such as libs, or BCPL units)
be my guest; but PLEASE add an update note to the signature
data that appears when you type ViewDir with no following
information. I'd hate to get questions on code that
somebody else wrote.
You may redirect output, of course. And ViewDir responds to
Ctrl-C and stops immediately, echoing "^C".
Revisions, 1990/1991: Major agony for a result that might not
be noticeable to the average user. Supplying a file name rather
than a directory gives more detail than before. A directory
now includes a "summary" line at the end, so that you see contents
and total. Parsing greatly expanded to support SPAT usage.
Current directory specified with VIEWDIR "". File "notes"
has more detail.
--Jim B